package com.example.icedcap.topeka_fake.model.quiz;

import android.os.Parcel;

import com.example.icedcap.topeka_fake.helper.AnswerHelper;

/**
 * Author: doushuqi
 * Date: 15/7/15
 * Time: 上午11:21
 * Email: shuqi.dou@singuloid.com
 */
public final class MultiSelectQuiz extends OptionQuiz<String> {


    public MultiSelectQuiz(String question, int[] answer, String[] options, boolean solved) {
        super(question, answer, options, solved);
    }

    @SuppressWarnings("unused")
    protected MultiSelectQuiz(Parcel in) {
        super(in);
        String[] options = in.createStringArray();
        setOptions(options);
    }

    @Override
    public QuizType getQuizType() {
        return QuizType.MULTI_SELECT;
    }

    @Override
    public String getStringAnswer() {
        return AnswerHelper.getAnswer(getAnswer(), getOptions());
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeStringArray(getOptions());
    }
}
